﻿using UnityEngine;
using System.Collections;

public class Destroyer : MonoBehaviour
{
    void OnEnable()
    {
        Invoke("Destroy", 2f);
    }

    void Destroy()
    {
        ObjectPool.instance.Remove(gameObject);
    }

    void OnDisable()
    {
        CancelInvoke();
    }
}
